import http from "./http.js"
//登录
const login = params => http.fetchPost("/teach-user/login",params);


/*****新闻*****/
//获取新闻列表
const selectNewsList = params => http.fetchPost("/teach-dev-manager/news/selectNewsList",params);
//更新新闻状态 和 下架
const updateStatusById = params => http.fetchPost("/teach-dev-manager/news/updateStatusById",params);
//根据id获取新闻详情
const getNewsDetail = id => http.fetchPost("/teach-dev-manager/news/newsDetail",{id:id});
//发布新闻
const insertNews = params => http.fetchPost("/teach-dev-manager/news/insertNews",params);
//批量删除新闻
const deleNews = params => http.fetchPost("/teach-dev-manager/news/batchDele",params);
//批量审批和下架
const catchUpdateNews = params => http.fetchPost("/teach-dev-manager/news/catchUpdate",params);

//新增新闻分类
const insertNewsCategorys = params => http.fetchPost("/teach-dev-manager/newsCategorys/insertNewsCategorys",params);
//修改新闻分类
const updateNewsCategorys = params => http.fetchPost("/teach-dev-manager/newsCategorys/updateNewsCategorys",params);
//新闻分类列表
const selectNewsCategorys = params => http.fetchPost("/teach-dev-manager/newsCategorys/selectNewsCategorys",params);
//删除新闻分类
const deleNewsCategorys = id => http.fetchPost("/teach-dev-manager/newsCategorys/deleNewsCategorys",{id:id});


/*****培训*****/ 
//获取培训列表
const selectTrainList = params => http.fetchPost("/teach-dev-manager/train/selectTrainList",params);
//查询培训计划列表
const selectTrainPlanList = params => http.fetchPost("/teach-dev-manager/train/selectTrainPlanList",params);
//根据培训id查询培训计划
const selectTrainPlanByTrainId = id => http.fetchPost("/teach-dev-manager/trainPlan/selectTrainPlanByTrainId",{trainId:id});
//新增或修改培训和培训计划
const insertTrainAndTrainPlan = params => http.fetchPost("/teach-dev-manager/train/insertTrainAndTrainPlan",params);
//修改培训状态
const updateBatchByStatus = params => http.fetchPost("/teach-dev-manager/train/updateBatchByStatus",params);
//新增或修改培训分类
const insertTrainCategory = params => http.fetchPost("/teach-dev-manager/trainCategorys/insertCategory",params);
//删除培训分类
const deleTrainCategoryById = id => http.fetchPost("/teach-dev-manager/trainCategorys/deleCategoryById",{id:id});
//查询培训分类列表
const selectTrainCategoryList = params => http.fetchPost("/teach-dev-manager/trainCategorys/selectCategoryList",params);
//查询已发布的培训
const selectTrainListBYstatustwo = params => http.fetchPost("/teach-dev-manager/train/selectTrainListBYstatustwo",params);


//查询培训报名列表
const selectEnrollList = params => http.fetchPost("/teach-dev-manager/enroll/selectEnrollList",params);
//批量审核报名
const batchREviewExamine = params => http.fetchPost("/teach-dev-manager/enroll/batchUpdateExamine",params);
//后台报名
const backEnroll = params => http.fetchPost("/teach-dev-manager/enroll/backEnroll",params);

//查询用户列表
const selectUserList = (id) => http.fetchPost("/teach-dev-manager/enroll/selectUserList",{trainPlanId:id});
//图片上传
const photoUpload  = (params) => http.upload("/upload-project/upload/photoUpload",params);


/*****系统设置*****/ 
//获取组织列表
const selectGroupList = params => http.fetchPost("/teach-user/group/selectGroupList",params);
//新增或修改组织
const insertOrganizeGroup = params => http.fetchPost("/teach-user/group/insertGroup",params);
//删除组织
const deleteGroup = parentGroupId => http.fetchPost("/teach-user/group/deleteGroup",parentGroupId);

export default{
	login,
	selectNewsList,
	updateStatusById,
	getNewsDetail,
	insertNewsCategorys,
	updateNewsCategorys,
	selectNewsCategorys,
	deleTrainCategoryById,
	selectTrainCategoryList,
	deleNews,
	deleNewsCategorys,
	catchUpdateNews,
	insertNews,
	insertTrainCategory,
	selectEnrollList,
	selectTrainList,
	selectTrainPlanByTrainId,
	insertTrainAndTrainPlan,
	updateBatchByStatus,
	selectTrainListBYstatustwo,
	selectUserList,
	batchREviewExamine,
	backEnroll,
	photoUpload,
	selectGroupList
}